package com.ycq.webssm.controller;

import com.sun.xml.internal.bind.v2.runtime.output.SAXOutput;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;


@Controller
public class RequestMappingController {


    @RequestMapping(value = {"/success", "/aaaaa"})
    public String success() {

        return "success";
    }


    //@RequestMapping("/a?a/testAnt")
    //@RequestMapping("/a*a/testAnt")
    @RequestMapping("/**/testAnt")
    public String testAnt() {
        return "success";
    }


    @RequestMapping("/testPath/{id}")
    public String testPath(@PathVariable("id") String id) {
        System.out.println(id);
        return "success";
    }


    @RequestMapping("/param")
    public String testParam() {
        return "test_param";
    }


    @PostMapping("/testRequestApi")
    public String testRequestApi(HttpServletRequest request) {
        request.getParameter("");
        return "success";
    }

    @PostMapping("/testRequestApi")
    public String testCookie(@CookieValue("JSESSIONID")String JSESSIONID) {
        System.out.println(JSESSIONID);
        return "success";
    }

}
